package org.aeon.gamechatnest.pojo;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Null;
import lombok.Data;
import org.aeon.gamechatnest.validated.Add;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * 好友联系表
 *
 * @TableName friend
 */
@Data
@Schema(description = "好友联系实体", name = "Friend")
@TableName("friend")
public class Friend implements Serializable {
    /**
     * 好友关系id
     */
    @Schema(description = "好友编号id", name = "friendId")
    @Null(groups = Add.class, message = "新增时friendId应该为空")
    @TableId
    private Long friendId;

    /**
     * 用户1
     */
    @Schema(description = "用户1", name = "fromUser")
    @Null(groups = Add.class, message = "新增时fromUser应该为空")
    private Long fromUser;

    /**
     * 用户2
     */
    @Schema(description = "用户2", name = "toUser")
    @Null(groups = Add.class, message = "新增时toUser应该为空")
    private Long toUser;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间", name = "createTime")
    @Null(groups = Add.class, message = "新增时createTime应该为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @Serial
    private static final long serialVersionUID = 1L;
}
